extends Area2D

var battle_ground = preload("res://scene/battle_ground/battle_ground.tscn")

@onready var world = get_tree().get_first_node_in_group("world")

func _on_body_entered(body: Node2D) -> void:
	if "Player" in body.name:
		#播放动画持续0.8秒
		%BattleLoadingAnimation.battle_loading_animation_play()
		await get_tree().create_timer(0.8).timeout
		#加载战斗背景
		var new_battle_ground = battle_ground.instantiate()
		world.add_child(new_battle_ground)
#		queue_free()
		
		
		
		
		
